import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/Home/index.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: "/home",
      name: "home",
      redirect: '/home/echart',
      component: Home,
      children: [
        {
          path: "/home/echart",
          name: "echart",
          component: () => import("../views/EchartView.vue"),
        },
        {
          path: "/home/detail",
          name: "detail",
          component: () => import("../views/DetailView/index.vue"),
        },
        {
          path: "/home/comments",
          name: "comments",
          component: () => import("../views/CommentView/index.vue"),
        },
      ]
    },
  ],
});

export default router;
